package com.zlzxm.sorting.ui.adapter

import com.bumptech.glide.Glide
import com.bumptech.glide.load.resource.bitmap.CenterCrop
import com.bumptech.glide.load.resource.bitmap.RoundedCorners
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.zlzxm.sorting.R
import com.zlzxm.sorting.globe.dp2px
import com.zlzxm.sorting.globe.picOne
import com.zlzxm.sorting.ui.adapter.entity.EntityCaozuo

class AdapterCaozuoProduct : BaseQuickAdapter<EntityCaozuo,BaseViewHolder> (R.layout.item_cao_zuo_product){
    override fun convert(holder: BaseViewHolder, item: EntityCaozuo) {
        Glide.with(context)
            .load(picOne)
            .transform(CenterCrop(), RoundedCorners(dp2px(10f)))
            .into(holder.getView(R.id.ivFace))
        holder.setText(R.id.tvProductName,item.title)
    }
}